{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 3a. Calculate fO2 from melt ST for a single melt composition from a dataframe using default options" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Python set-up\n", "You need to install VolFe once on your machine, if you haven't yet. Then we need to import a few Python packages (including VolFe)." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Install VolFe on your machine. Don't remove the # from this line!\n", "# pip install VolFe # Remove the first # in this line if you have not installed VolFe on your machine before.\n", "\n", "# import python packages\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import VolFe as vf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define the inputs\n", "\n", "At a minimum to run an S-2-fO2 calculation, we need a dataframe of the melt composition and Fe in the melt [note 1], and temperature:\n", "\n", "- Sample is just the name for this analysis.\n", "\n", "- Temperature is in °C.\n", "\n", "- Volatile-free melt composition is in wt% oxides [note 2]. All these oxides must be present in the dataframe, so set them to 0. if you have no data for them (although see [note 1] around FeOT).\n", "\n", "- H2O is all hydrogen in the melt reported as H2O in wt% [note 3]. \n", "\n", "- CO2ppm is all carbon in the melt reported as CO2 in ppm [note 3].\n", "\n", "- STppm is all sulfur in the melt reported as S in ppm [note 3].\n", "\n", "- Xppm is all \"X\" in the melt reported as \"X\" in ppm [note 3]. \"X\" is an unreactive melt species whose identity can be changed - this is explored Example 1d.\n", "\n", "[note 1] In this example we specify Fe in the melt as FeOT - other options are possible, such as Fe2O3,T or FeO and Fe2O3.\n", "\n", "[note 2] It does not matter what the non-volatile oxides sum too - they are renormalised to 100 wt% minus the total of the volatiles (i.e., H2O + CO2 + ST + \"X\").\n", "\n", "[note 3] The volatile concentrations are absolute for the melt = i.e., the non-volatile melt composition is normalised to 100 wt% minus the volatiles. The volatiles are not added to the oxides and then renormalised.\n", "\n", "The following composition is analysis Sari15-04-34 from Brounce et al. (2014), with a temperature chosen as 1200 °C. We'll run at Pvsat (based on the volatile content) for now so we don't have to specify a P." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Sample T_C SiO2 TiO2 Al2O3 FeOT MnO MgO CaO Na2O \\\n", "0 Sari15-04-34 1200.0 46.94 0.65 16.0 8.92 0.15 7.3 13.94 1.61 \n", "\n", " K2O P2O5 H2O CO2ppm STppm Xppm \n", "0 0.26 0.07 3.83 1109.0 1614.12 0.0 \n" ] } ], "source": [ "# Define the melt composition and T as a dictionary.\n", "my_analysis = {'Sample':'Sari15-04-34',\n", " 'T_C': 1200., # Temperature in 'C\n", " 'SiO2': 46.94, # wt%\n", " 'TiO2': 0.65, # wt%\n", " 'Al2O3': 16.0, # wt%\n", " 'FeOT': 8.92, # wt%\n", " 'MnO': 0.15, # wt%\n", " 'MgO': 7.3, # wt%\n", " 'CaO': 13.94, # wt%\n", " 'Na2O': 1.61, # wt%\n", " 'K2O': 0.26, # wt%\n", " 'P2O5': 0.07, # wt%\n", " 'H2O': 3.83, # wt%\n", " 'CO2ppm': 1109., # ppm\n", " 'STppm': 1614.12, # ppm\n", " 'Xppm': 0.} # ppm\n", "\t\t\t\t\t\t\t\t\t\t\t\t\t\n", "# Turn the dictionary into a pandas dataframe, setting the index to 0.\n", "my_analysis = pd.DataFrame(my_analysis, index=[0])\n", "\n", "# Show the DataFrame.\n", "print(my_analysis)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For this example we will use the default options in VolFe, which can be found below:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " option\n", "type \n", "COH_species yes_H2_CO_CH4_melt\n", "H2S_m True\n", "species X Ar\n", "Hspeciation none\n", "fO2 Kress91A\n", "... ...\n", "error 0.1\n", "print status False\n", "output csv True\n", "setup False\n", "high precision False\n", "\n", "[78 rows x 1 columns]\n" ] } ], "source": [ "# print default options in VolFe\n", "print(vf.default_models)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run the calculation\n", "\n", "### At Pvsat\n", "\n", "And below runs the calculation - it outputs a dataframe of the full results. So in this example, the sample would be sulfide-saturated but doesn't have enough sulfur to be anhydrite saturated." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | sample | \n", "T ('C) | \n", "H2OT-eq_wtpc | \n", "CO2T-eq_ppmw | \n", "ST_ppmw | \n", "X_ppmw | \n", "P (bar) sulf | \n", "S2- SCSS | \n", "sulfide saturated? | \n", "DFMQ-sulfide | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Sari15-04-34 | \n", "1200.0 | \n", "3.83 | \n", "1109.0 | \n", "1614.12 | \n", "0.0 | \n", "3209.679276 | \n", "1071.669795 | \n", "True | \n", "0.905944 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-02 12:10:37.752486 | \n", "
1 rows × 67 columns
\n", "| \n", " | sample | \n", "T ('C) | \n", "H2OT-eq_wtpc | \n", "CO2T-eq_ppmw | \n", "ST_ppmw | \n", "X_ppmw | \n", "P (bar) sulf | \n", "S2- SCSS | \n", "sulfide saturated? | \n", "DFMQ-sulfide | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Sari15-04-34 | \n", "1200.0 | \n", "3.83 | \n", "1109.0 | \n", "1614.12 | \n", "0.0 | \n", "1000.0 | \n", "930.456494 | \n", "possible | \n", "1.158861 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-02 09:58:12.197469 | \n", "
1 rows × 67 columns
\n", "| \n", " | sample | \n", "T ('C) | \n", "H2OT-eq_wtpc | \n", "CO2T-eq_ppmw | \n", "ST_ppmw | \n", "X_ppmw | \n", "P (bar) sulf | \n", "S2- SCSS | \n", "sulfide saturated? | \n", "DFMQ-sulfide | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Sari15-04-34 | \n", "1200.0 | \n", "3.83 | \n", "1109.0 | \n", "1614.12 | \n", "0.0 | \n", "3223.517523 | \n", "867.284719 | \n", "True | \n", "1.023231 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-02 09:59:13.344561 | \n", "
1 rows × 67 columns
\n", "